#include "Consumer.h"
#include "Producer.h"
#include "ProductQueue.h"
#include <thread>
#include <iostream>
using std::thread;
using std::endl;
using std::cout;
void test()
{
    ProductQueue proque(20);
    //创建两个对象
    Producer proobj;
    Consumer conobj;

    //创建两个线程
    thread pro(&Producer::produce, &proobj, std::ref(proque));
    thread con(&Consumer::consume, &conobj, std::ref(proque));

    pro.join();
    con.join();
}
int main(int argc, char *argv[])
{
    test();
    return 0;
}

